<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>2</title>
</head>
<body>
    <script>
        var a = prompt("请输入你的出生年月");("请输入你的出生年月")
        var b = 2022;
        var c = b-a;
        var d ="你的年龄为"+c+"岁";
        document.write(d);
        
    </script>
</body>
</html>